package com.webapi.core.model.dto;

import com.webapi.common.utils.DateUtils;
import com.webapi.core.model.common.PayStatus;
import com.webapi.core.model.common.PayType;
import com.webapi.core.model.persist.Pay;

public class PayDto extends BaseDto {

    private PayType type;
    private Double amount;
    private PayStatus status;
    private String payTime;

    public PayType getType() {
        return type;
    }

    public void setType(PayType type) {
        this.type = type;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public PayStatus getStatus() {
        return status;
    }

    public void setStatus(PayStatus status) {
        this.status = status;
    }

    public String getPayTime() {
        return payTime;
    }

    public void setPayTime(String payTime) {
        this.payTime = payTime;
    }

    public static PayDto valueOf(Pay pay) {
        PayDto dto = new PayDto();
        dto.setId(pay.getId());
        dto.setAmount(pay.getAmount());
        dto.setType(pay.getType());
        dto.setStatus(pay.getStatus());
        dto.setPayTime(DateUtils.date2stringLong(pay.getPayTime()));
        dto.setCreateTime(DateUtils.date2stringLong(pay.getCreateTime()));
        return dto;
    }

    @Override
    public String toString() {
        return "PayDto [type=" + type + ", amount=" + amount + ", status="
                + status + ", payTime=" + payTime + ", getId()=" + getId()
                + ", getCreateTime()=" + getCreateTime() + "]";
    }
    
    
}
